using UnityEngine;
using System.Collections;

public class door : MonoBehaviour {

	public bool open;

	private Animator anim;

	// Use this for initialization
	void Start () {

		anim = GetComponent<Animator> ();
		if(open == true)
		{
			Debug.Log("set to open");
			anim.SetBool("open",true);
		}
	}

	// Update is called once per frame
	void Update () {

	}

	public void activateDoor()
	{
		Debug.Log ("door to");
		if(open==true)
		{
			Debug.Log("close");
			anim.SetBool("open",false);
			open=false;
		}
		else
		{
			Debug.Log("open");
			anim.SetBool("open",true);
			open=true;
		}
	}	
}